package com.ktwlsoft.archivemanage.payload.study.subject;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;

@Data
public class SaveSubjectRequest {

    private Long id;

    @ApiModelProperty("目的, ADD添加, EDIT编辑")
    private String purpose;

    @NotNull
    @Size(max = 20, message = "标题不能超过20字符")
    private String title;

    @NotNull
    @Size(max = 50, message = "标签不能超过50字符")
    private String tag;

    @Size(max = 200, message = "主图不能超过200字符")
    private String mainImgUrl;

    @NotNull
    private String state;

    private List<SaveSubjectClassRequest> classes = new ArrayList<>();

    public SaveSubjectRequest() {
    }

    public SaveSubjectRequest(String purpose,
                              @NotNull @Size(max = 20, message = "标题不能超过20字符") String title,
                              @NotNull @Size(max = 50, message = "标签不能超过50字符") String tag,
                              @Size(max = 200, message = "主图不能超过200字符") String mainImgUrl,
                              @NotNull String state) {
        this.purpose = purpose;
        this.title = title;
        this.tag = tag;
        this.mainImgUrl = mainImgUrl;
        this.state = state;
    }
}
